<!DOCTYPE html>
<html>
<head>
    <title>管理员列表 - 后台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css" href="../../../static/layui/css/layui.css" media="all">
    <script type="text/javascript" src="../../../static/layui/layui.js"></script>
    <style type="text/css">
        .header span{background:#009688;margin-left:30px;padding:10px;color:#ffffff;}
        .header div{border-bottom:solid 2px #009688;margin-top: 8px;}
        .header button{float:right;margin-top:-5px;}
    </style>
</head>
<body style="padding:10px; box-sizing: border-box;">
<form class="layui-form">
    <input type="hidden" class="layui-input" name="id" value="{$find['id']}">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="title" placeholder="请输入标题" value="{$find['title']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">关键词</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="keywords" placeholder="请输入关键词" value="{$find['keywords']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">描述</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="desc" placeholder="请输入描述" value="{$find['desc']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">作者名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="author" placeholder="请输入作者名称" value="{$find['author']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">thumb</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="thumb" placeholder="请输入thumb" value="{$find['thumb']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="demo" class="layui-form-label">content</label>
        <textarea id="demo" style="display: none;"></textarea>
    </div>
    <input type="hidden" id="myText" value="{$find['content']}">
    <input type="hidden" id="content" name="content">
    <div class="layui-form-item">
        <label class="layui-form-label">click</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="click" placeholder="请输入click" value="{$find['click']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">zan</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="zan" placeholder="请输入zan" value="{$find['zan']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">rec</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="rec" placeholder="请输入rec" value="{$find['rec']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">time</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="time" placeholder="请输入time" value="{$find['time']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">contenten</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" placeholder="请输入contenten" value="{$find['contenten']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">cateid</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="cateid" placeholder="请输入cateid" value="{$find['cateid']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">admin</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="admin" placeholder="请输入admin" value="{$find['admin']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">date</label>
        <div class="layui-input-inline">
            <input type="date" class="layui-input" name="date" placeholder="请输入date">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">suspendtime</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="suspendtime" placeholder="请输入suspendtime" value="{$find['suspendtime']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">titleen</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="titleen" placeholder="请输入titleen" value="{$find['titleen']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">EC</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="EC" placeholder="请输入EC" value="{$find['EC']}">
        </div>
    </div>
</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="button" class="layui-btn" id="save">保存</button>
    </div>
</div>
<script type="text/javascript">
    layui.use(['form'],function(){
        form = layui.form;
        $ = layui.jquery
    });

    layui.use('layedit', function(){
        var layedit = layui.layedit;
        var index = layedit.build('demo',{
            tool: [
                'strong' //加粗
                ,'italic' //斜体
                ,'underline' //下划线
                ,'del' //删除线
                ,'|' //分割线
                ,'left' //左对齐
                ,'center' //居中对齐
                ,'right' //右对齐
                ,'link' //超链接
                ,'unlink' //清除链接
                ,'face' //表情
                ,'image' //插入图片
                ,'help' //帮助
            ]
        }); //建立编辑器


        layedit.sync(index);
        var myText = document.getElementById("myText").value
        // console.log(myText)
        layedit.setContent(index,myText)

        $("#save").click(function (){
            layedit.sync(index);
            var text = $("#demo").val()
            $("#content").val(text)


            $.post("/tp5/public/index.php/bews/Article/articleModify",$('form').serialize(),function (res){
                console.log("res "+res)
                if(res.code === 0){
                    layer.msg(res.msg,{'icon':1})
                    setTimeout(function (){
                        parent.window.location.reload();   // 关闭上一层页面
                    },1000)
                }else{
                    layer.msg(res.msg,{'icon':2})
                }
            },'json')
        })

    });

    /*function save(){
        $.post("/tp5/public/index.php/bews/Book/bookModify",$('form').serialize(),function (res){
            console.log("res "+res)
            if(res.code === 0){
                layer.msg(res.msg,{'icon':1})
                setTimeout(function (){
                    parent.window.location.reload();   // 关闭上一层页面
                },1000)
            }else{
                layer.msg(res.msg,{'icon':2})
            }
        },'json')
    }*/
</script>
</body>
</html>
